
#include "xdns.h"
#include <arpa/inet.h>

using namespace std;

XdnsServerConfig::XdnsServerConfig()
: m_serverPort(0),
  m_serverIpAddress()
{
}

XdnsServerConfig::XdnsServerConfig(unsigned short serverPort,
                                   const string& serverIpAddress)
: m_serverPort(htons(serverPort)),
  m_serverIpAddress(serverIpAddress)
{
}

XdnsServerConfig::XdnsServerConfig(const XdnsServerConfig& anotherServerConfig)
: m_serverPort(anotherServerConfig.m_serverPort),
  m_serverIpAddress(anotherServerConfig.m_serverIpAddress)
{
}

XdnsServerConfig::~XdnsServerConfig()
{
}

XdnsServerConfig&
XdnsServerConfig::operator=(const XdnsServerConfig& anotherServerConfig)
{
    if ((&anotherServerConfig) != this)
    {
        this->m_serverPort = anotherServerConfig.m_serverPort;
        this->m_serverIpAddress = anotherServerConfig.m_serverIpAddress;
    }

    return *this;
}

